//
//  MyViewCell.m
//  Tour
//
//  Created by hesiyao on 16/3/15.
//  Copyright © 2016年 张中烨. All rights reserved.
//

#import "MyViewCell.h"

@implementation MyViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.titleView = [[UIImageView alloc] init];
        self.titleView.contentMode = UIViewContentModeScaleAspectFill;
        self.titleView.clipsToBounds = YES;
        [self.contentView addSubview:self.titleView];
        
        self.label = [[BaseLabel alloc] init];
        [self.contentView addSubview:self.label];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.titleView.frame = CGRectMake(2, 2, self.contentView.frame.size.height - 4, self.contentView.frame.size.height - 4);
    self.label.frame = CGRectMake(self.titleView.frame.origin.x + self.titleView.frame.size.width + 5, self.titleView.frame.origin.y, self.contentView.frame.size.width - 10 - self.titleView.frame.size.width, self.titleView.frame.size.height);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
